home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / snpd1292.zip / GETKEY.C < prev    next >
C/C++ Source or Header  |  1992-12-26  |  486b  |  28 lines

  1. /*
  2. **  Originally published as part of the MicroFirm Function Library
  3. **
  4. **  Copyright 1986, S.E. Margison
  5. **  Copyright 1989-92, Robert B.Stout
  6. **
  7. **  Subset version released to the public domain, 1990
  8. */
  9.  
  10. #include <conio.h>
  11.  
  12. int getkey(void)
  13. {
  14.       int i;
  15.  
  16.       switch (i = (int)getch())
  17.       {
  18.       case 0xe0:
  19. #ifdef MSDOS
  20.             return i;
  21. #endif
  22.       case 0:
  23.             return 256 + (int)getch();
  24.       default:
  25.             return i;
  26.       }
  27. }
  28.